// -*- c++ -*-

#version 330 core

layout (location = 0) in vec3 in_pos;
layout (location = 1) in vec3 in_col;
layout (location = 2) in vec3 in_norm;
layout (location = 3) in vec2 in_tex_coords;
    
out VS_OUT
  {
    vec3 frag_pos;
    vec3 frag_norm;
    vec3 frag_color;
    vec2 frag_tex_coords;
  }
vs_out;

layout (std140) uniform Matrices
{
  mat4 projection;
  mat4 model;
  mat3 normal;
}
matrices;

void main ()
{
  vs_out.frag_pos = vec3(matrices.model * vec4(in_pos, 1.f));
  vs_out.frag_norm = matrices.normal * in_norm;
  vs_out.frag_color = in_col;
  vs_out.frag_tex_coords = in_tex_coords;

  gl_Position = matrices.projection * matrices.model * vec4(in_pos, 1.f);
}
